import Nofound from '.././views/Nofound.vue'
import Login from '.././views/Login.vue'
import Iframe from '.././views/Iframe.vue'
import Main from '.././views/rbac/Main.vue'
import MenuTree from '.././views/rbac/MenuTree.vue'
import DepartmentList from '.././views/rbac/DepartmentList.vue'
import RoleList from '.././views/rbac/RoleList.vue'
import AdminList from '.././views/rbac/AdminList.vue'
import LogList from '.././views/rbac/LogList.vue'
import AdminEditInfo from '.././views/rbac/AdminEditInfo.vue'
import AdminEditPwd from '.././views/rbac/AdminEditPwd.vue'
import Config from '.././views/common/Config.vue'
import TypeList from '.././views/common/TypeList.vue'
import ArticleList from '.././views/content/ArticleList.vue'
import ArticleAdd from '.././views/content/ArticleAdd.vue'
import ArticleEdit from '.././views/content/ArticleEdit.vue'
import CateAdd from '.././views/content/CateAdd.vue'
import CateEdit from '.././views/content/CateEdit.vue'
import CateList from '.././views/content/CateList.vue'
import AdPos from '.././views/content/AdPos.vue'
import Ad from '.././views/content/Ad.vue'
import Link from '.././views/content/Link.vue'
import LinkType from '.././views/content/LinkType.vue'

const routers = [
	// 登录
	{
		path: '/',
		name: 'login',
		component: Login,
		meta: { requiresAuth: false }
	},
	// 内容的模板
	{
		path: '/',
		component: Iframe,
		meta: { requiresAuth: true },
		children: [
			//  友情链接页面
			{
				path: 'link/list',
				name: 'link-list',
				component: Link,
			},
			{
				path: 'linktype/list',
				name: 'linktype-list',
				component: LinkType,
			},
			// 广告页面
			{
				path: 'ad/list',
				name: 'ad-list',
				component: Ad,
			},
			// 广告位页面
			{
				path: 'adpos/list',
				name: 'adpos-list',
				component: AdPos,
			},
			// 栏目页面
			{
				path: 'category/list',
				name: 'category-list',
				component: CateList,
			},
			// 添加栏目
			{
				path: 'category/create',
				name: 'category-create',
				component: CateAdd,
			},
			// 修改栏目
			{
				path: 'category/update',
				name: 'category-update',
				component: CateEdit,
			},
			// 文章列表
			{
				path: 'article/list',
				name: 'article-list',
				component: ArticleList,
			},
			// 添加文章
			{
				path: 'article/create',
				name: 'article-create',
				component: ArticleAdd,
			},
			// 修改文章
			{
				path: 'article/update',
				name: 'article-update',
				component: ArticleEdit,
			},
			// 操作日志
			{
				path: 'log/list',
				name: 'log-list',
				component: LogList,
			},
			// 分类管理
			{
				path: 'type/list',
				name: 'type-list',
				component: TypeList,
			},
			// 系统设置
			{
				path: 'config/index',
				name: 'config-index',
				component: Config,
			},
			// 用户
			{
				path: 'admin/list',
				name: 'admin-list',
				component: AdminList,
			},
			{
				path: 'admin/selfinfo',
				name: 'admin-selfinfo',
				component: AdminEditInfo,
			},
			{
				path: 'admin/selfpassword',
				name: 'admin-selfpassword',
				component: AdminEditPwd,
			},
			// 角色
			{
				path: 'role/list',
				name: 'role-list',
				component: RoleList,
			},
			// 部门
			{
				path: 'department/list',
				name: 'department-list',
				component: DepartmentList,
			},
			// 权限菜单
			{
				path: 'menu/tree',
				name: 'menu-tree',
				component: MenuTree,
			},
			// 首页
			{
				path: 'index/index',
				name: 'index-index',
				component: Main
			}
		]
	},
	// 其它404
	{
		path: '/:catchAll(.*)',
		name: 'noaccess',
		meta: { requiresAuth: false },
		component: Nofound
	}
]

export default routers